package com.zzjx.datasource;

import javax.servlet.*;
import java.io.IOException;

public class DataSourceFilter implements Filter {


    @Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {

        try {
            filterChain.doFilter(servletRequest, servletResponse);
        } finally {
            DataSourceContextHolder.clearDataSource();
        }
    }
}
